<?php
namespace app\common\validate;

use think\Validate;

class WorkLogValidate extends Validate
{
    protected $rule =   [
        'id'                        => 'require|integer',
        'user_id|用户ID'            => 'require|integer',
        'project_id|项目ID'         => 'require|integer',
        'page|页数'                 => 'require|integer',
        'limit|条数'                => 'require|integer',
        'sky_status|天气状况'       => 'require|length:1,50',
        'wind|风力'                 => 'require|length:1,50',
        'temperature|温度'          => 'require|length:1,20',
        'produce_status|生产情况'   => 'require|length:1,2000',
        'safety_record|安全记录'    => 'require|length:1,2000',
        'remark|备注'               => 'require|length:1,255',
        'submit_time|提交时间'      => 'require|date',
        'start_time|提交时间'       => 'require|date',
        'end_time|提交时间'         => 'require|date',
    ];
    
    protected $scene = [
        /** 接口 */
        'add'         => ['user_id', 'project_id', 'sky_status', 'wind', 'temperature', 'produce_status', 'safety_record', 'remark', 'submit'],
        'list'        => ['user_id', 'project_id', 'page', 'limit', 'start_time', 'end_time'],
    ];
}